import React, { Component } from 'react'
import {
  // Button,
  Table,
  message,
  Tabs,
} from 'antd'
import {
  // UploadOutlined,
  DownloadOutlined,
} from '@ant-design/icons'
import 'antd/dist/antd.css'
import {
  queryExamPage,
  asyncExamExport,
  queryRecordPage,
  asyncRecordExport,
} from '../../api2'
import { confirmDeptByCode } from '../../utils/index.js'
import moment from 'moment'
import 'moment/locale/zh-cn'
import AdvancedSearchForm from '../../componentJsx/common/searchForm'
import HasPermi from '../../componentJsx/common/hasPermi'
import NewModal from '../../componentJsx/common/NewModal'
import '../../componentCss/component.css'
//字典
import {
  getDictionaryLabel,
  getRegionLableLabel,
} from '../../rudexRou/OperatesCookie.js'
import '../Evaluate/index.css'
// import { values } from "underscore";
// import { T } from "antd/lib/upload/utils";

class Index extends Component {
  constructor(props) {
    super(props)
    this.state = {
      recordModalVisible: false, //模态框
      examModalVisible: false,
      downState: null,
      confirmLoading: false, //确认按钮异步等待
      recordLoading: false, //表格等待
      examLoading: false, //表格等待
      //表格多选
      recordSelectedRowKeys: [],
      recordSelectedRows: [],
      examSelectedRowKeys: [],
      examSelectedRows: [],
      //分页
      recordTotal: 0,
      pageSize: 10,
      page: 1,
      examTotal: 0,
      examPageSize: 10,
      examPage: 1,
      //数据
      recordData: [],
      examData: [],
      //表格列
      recordColumns: [
        {
          fixed: 'left',
          title: '工号',
          dataIndex: 'empNo',
          key: 'empNo',
          width: 80,
        },
        {
          fixed: 'left',
          title: '姓名',
          dataIndex: 'empName',
          key: 'empName',
          width: 100,
        },
        {
          title: '地域',
          dataIndex: 'regionName',
          key: 'regionName',
          ellipsis: true,
          width: 100,
        },
        {
          title: '部门BD',
          dataIndex: 'orgBdName',
          key: 'orgBdName',
          width: 270,
          ellipsis: true,
        },
        {
          title: '部门BU',
          dataIndex: 'orgBuName',
          key: 'orgBuName',
          width: 270,
          ellipsis: true,
        },
        {
          title: '部门CU',
          dataIndex: 'orgCuName',
          key: 'orgCuName',
          width: 270,
          ellipsis: true,
        },

        {
          title: '是否转正',
          dataIndex: 'probationPeriod',
          key: 'probationPeriod',
          width: 80,
          ellipsis: true,
          render: (text) =>
            text ? getDictionaryLabel('isProbation', text) : text,
        },
        {
          title: '办公地类型',
          dataIndex: 'typeofOffice',
          key: 'typeofOffice',
          width: 100,
          ellipsis: true,
          render: (text) =>
            text ? getDictionaryLabel('officeType', text) : text,
        },
        {
          title: '办公地',
          dataIndex: 'officeAddress',
          key: 'officeAddress',
          width: 80,
          ellipsis: true,
        },
        {
          title: '软通邮箱',
          dataIndex: 'email',
          key: 'email',
          width: 240,
          ellipsis: true,
        },
        {
          title: '是否入OMP',
          dataIndex: 'intoOmp',
          key: 'intoOmp',
          width: 100,
          ellipsis: true,
          render: (text) =>
            text ? getDictionaryLabel('yesOrNoOmp', text) : text,
        },
        {
          title: '华为工号',
          dataIndex: 'hwCode',
          key: 'hwCode',
          width: 80,
          ellipsis: true,
        },
        {
          title: '华为邮箱',
          dataIndex: 'hwEmail',
          key: 'hwEmail',
          width: 140,
          ellipsis: true,
        },
        {
          title: '是否涉及代码',
          dataIndex: 'involvingCode',
          key: 'involvingCode',
          width: 110,
          ellipsis: true,
          render: (text) => (text ? getDictionaryLabel('yesOrNo', text) : text),
        },
        // ！！
        // {
        //   title: '风险信息',
        //   dataIndex: 'riskInfo',
        //   key: 'riskInfo',
        //   width: 80,
        //   ellipsis: true,
        //   render: (t) => (t ? getDictionaryLabel("riskInfo", t) : t)
        // },
        {
          title: '岗位类型',
          dataIndex: 'category',
          key: 'category',
          width: 80,
          ellipsis: true,
          render: (text) =>
            text ? getDictionaryLabel('postCategory', text) : text,
        },
        {
          title: '主开发语言',
          dataIndex: 'mainDevelopmentLanguage',
          key: 'mainDevelopmentLanguage',
          width: 100,
          ellipsis: true,
          render: (text) =>
            text ? getDictionaryLabel('language', text) : text,
        },
        {
          title: '次开发语言',
          dataIndex: 'secondaryDevelopmentLanguage',
          key: 'secondaryDevelopmentLanguage',
          width: 100,
          ellipsis: true,
          render: (text) =>
            text ? getDictionaryLabel('language', text) : text,
        },

        {
          title: '新员工导师',
          dataIndex: 'newEmployeeTutor',
          key: 'newEmployeeTutor',
          width: 100,
          ellipsis: true,
        },
        {
          title: '项目经理',
          dataIndex: 'projectManager',
          key: 'projectManager',
          ellipsis: true,
          width: 80,
        },
        {
          title: '代码守护者',
          dataIndex: 'guardian',
          key: 'guardian',
          width: 100,
          ellipsis: true,
        },
        {
          title: '评定次数',
          dataIndex: 'evaluationNumberMR',
          key: 'evaluationNumberMR',
          width: 110,
          ellipsis: true,
        },

        {
          title: '最近评定时间',
          dataIndex: 'lastEvaluateTime',
          key: 'lastEvaluateTime',
          width: 110,
          ellipsis: true,
          render: (text) => (text ? moment(text).format('YYYY-MM-DD') : text),
        },
        {
          title: '最近评定结果',
          dataIndex: 'lastEvaluateResult',
          key: 'lastEvaluateResult',
          width: 110,
          ellipsis: true,
          render: (text) =>
            text ? getDictionaryLabel('reviewResult', text) : text,
        },
        {
          title: '是否参加可信训战营',
          dataIndex: 'trainingCamp',
          key: 'trainingCamp',
          width: 150,
          ellipsis: true,
          render: (text) => (text ? getDictionaryLabel('yesOrNo', text) : text),
        },
        {
          title: '入营时间',
          dataIndex: 'joinTime',
          key: 'joinTime',
          width: 110,
          ellipsis: true,
        },
        {
          title: '出营时间',
          dataIndex: 'joinLastTime',
          key: 'joinLastTime',
          width: 110,
          ellipsis: true,
        },
        {
          title: '是否通过',
          dataIndex: 'isNoPass',
          key: 'isNoPass',
          width: 80,
          ellipsis: true,
          render: (text) => (text ? getDictionaryLabel('yesOrNo', text) : text),
        },
        {
          title: '修改人',
          dataIndex: 'updateUser',
          key: 'updateUser',
          ellipsis: true,
          width: 100,
          ellipsis: true,
        },
        {
          title: '修改时间',
          dataIndex: 'updateTime',
          key: 'updateTime',
          ellipsis: true,
          width: 160,
          ellipsis: true,
          render: (text) =>
            text ? moment(text).format('YYYY-MM-DD hh:mm:ss') : text,
        },
      ],
      examColumns: [
        {
          fixed: 'left',
          title: '工号',
          dataIndex: 'empNo',
          key: 'empNo',
          ellipsis: true,
          width: 80,
        },
        {
          fixed: 'left',
          title: '姓名',
          dataIndex: 'empName',
          key: 'empName',
          ellipsis: true,
          width: 100,
        },
        {
          title: '地域',
          dataIndex: 'regionName',
          key: 'regionName',
          ellipsis: true,
          width: 100,
        },
        {
          title: '部门BD',
          dataIndex: 'orgBdName',
          key: 'orgBdName',
          ellipsis: true,
          width: 270,
        },
        {
          title: '部门BU',
          dataIndex: 'orgBuName',
          key: 'orgBuName',
          ellipsis: true,
          width: 270,
        },
        {
          title: '部门CU',
          dataIndex: 'orgCuName',
          key: 'orgCuName',
          ellipsis: true,
          width: 270,
        },
        {
          title: '岗位类别',
          dataIndex: 'category',
          key: 'category',
          width: 80,
          ellipsis: true,
          render: (text) =>
            text ? getDictionaryLabel('postCategory', text) : text,
        },
        {
          title: '项目经理',
          dataIndex: 'projectManager',
          key: 'projectManager',
          width: 80,
        },
        {
          title: '风险信息',
          dataIndex: 'riskInfo',
          key: 'riskInfo',
          width: 80,
          render: (text) =>
            text ? getDictionaryLabel('riskInfo', text) : text,
        },
        {
          title: '是否发布',
          dataIndex: 'status',
          key: 'status',
          ellipsis: true,
          width: 80,
          render: (text) =>
            text ? getDictionaryLabel('reviewIsPublish', text) : text,
        },
        {
          title: '考试平台',
          dataIndex: 'examPlatform',
          key: 'examPlatform',
          width: 80,
          render: (text) =>
            text ? getDictionaryLabel('examPlatform', text) : text,
        },
        {
          title: '考试类别',
          dataIndex: 'examCategory',
          key: 'examCategory',
          width: 80,
          render: (text) =>
            text ? getDictionaryLabel('examType', text) : text,
        },
        {
          title: '考试级别',
          dataIndex: 'examLevel',
          key: 'examLevel',
          width: 80,
          render: (text) =>
            text ? getDictionaryLabel('examLevel', text) : text,
        },
        {
          title: '考试科目',
          dataIndex: 'examSubject',
          key: 'examSubject',
          ellipsis: true,
          width: 100,
          render: (text) =>
            text ? getDictionaryLabel('examSubject', text) : text,
        },
        {
          title: '考试时间',
          dataIndex: 'examDate',
          key: 'examDate',
          ellipsis: true,
          width: 100,
        },
        {
          title: '考试语言',
          dataIndex: 'examLanguage',
          key: 'examLanguage',
          width: 100,
          ellipsis: true,
          render: (text) =>
            text ? getDictionaryLabel('examLanguage', text) : text,
        },
        {
          title: '考试成绩',
          dataIndex: 'examScore',
          key: 'examScore',
          ellipsis: true,
          width: 80,
        },
        {
          title: '考试结果',
          dataIndex: 'examResult',
          key: 'examResult',
          ellipsis: true,
          width: 80,
          render: (text) =>
            text ? getDictionaryLabel('examResult', text) : text,
        },
        //考试时间+1年
        // {
        //   title: "成绩有效期",
        //   dataIndex: "examScoreOutdate",
        //   key: "examScoreOutdate",
        //   ellipsis: true,
        //   width: 100,
        //   render: (text) => text,
        // },
        {
          title: '考试组织人',
          dataIndex: 'examInitiatorEmpName',
          key: 'examInitiatorEmpName',
          ellipsis: true,
          width: 100,
        },
        // {
        //   title: "最近修改人",
        //   dataIndex: "updateUser",
        //   key: "updateUser",
        //   ellipsis: true,
        //   width: 100,
        // },
        // {
        //   title: "最近修改时间",
        //   dataIndex: "updateTime",
        //   key: "updateTime",
        //   ellipsis: true,
        //   width: 160,
        // },
      ],
      //查询条件
      recordSearchData: {},
      examSearchData: {},
      // 查询条件项配置
      recordSearchForm: [
        {
          type: 'select',
          name: '地域',
          code: 'area',
          options: getRegionLableLabel('addressConfig'),
        },
        {
          type: 'cascader',
          name: '部门',
          code: 'dept',
          options: JSON.parse(localStorage.getItem('deptList')),
        },
        {
          type: 'rangePicker',
          name: '评定时间段',
          code: 'time',
        },
      ],
      examSearchForm: [
        {
          type: 'select',
          name: '地域',
          code: 'area',
          options: getRegionLableLabel('addressConfig'),
        },
        {
          type: 'cascader',
          name: '部门',
          code: 'dept',
          options: JSON.parse(localStorage.getItem('deptList')),
        },
        {
          type: 'select',
          name: '考试类别',
          code: 'examCategory',
          options: getDictionaryLabel('examType'),
        },
        {
          type: 'select',
          name: '考试级别',
          code: 'examLevel',
          options: getDictionaryLabel('examLevel'),
        },
        {
          type: 'rangePicker',
          name: '考试时间段',
          code: 'time',
        },
      ],
      activeKey: '1',
    }
  }
  getFormatDate = (arg) => {
    if (arg == undefined || arg == '') {
      return ''
    }
    var re = arg + ''
    if (re.length < 2) {
      re = '0' + re
    }
    return re
  }
  addDate = (date, days) => {
    if (days == undefined || days == '') {
      days = 1
    }
    var date = new Date(date)
    date.setDate(date.getDate() + days)
    var month = date.getMonth() + 1
    var day = date.getDate()
    return (
      date.getFullYear() +
      '-' +
      this.getFormatDate(month) +
      '-' +
      this.getFormatDate(day)
    )
  }
  //时间戳转换
  getDate = (time, type) => {
    if (!time) return
    if (type === 'ymd') {
      return moment(time).format('YYYY-MM-DD')
    } else if (type === 'hms') {
      return moment(time).format('YYYY-MM-DD HH:mm:ss')
    }
  }
  //获取最新数据
  getRecordData = () => {
    this.setState({ recordLoading: true })
    let searchData = this.state.recordSearchData
    let data = {}
    for (const key in searchData) {
      if (searchData[key] || searchData[key] === 0) {
        if (key === 'dept') {
          const orgType = confirmDeptByCode(
            searchData[key][searchData[key].length - 1]
          )
          if (orgType && orgType.type == 'cu') {
            data.cuNo = orgType.value
          } else if (orgType && orgType.type == 'bu') {
            data.buNo = orgType.value
          } else if (orgType && orgType.type == 'bd') {
            data.bdNo = orgType.value
          }
        } else {
          data[key] = searchData[key]
        }
      }
    }
    data.pageSize = this.state.pageSize
    data.currentPage = this.state.page
    queryRecordPage(data)
      .then((res) => {
        if (res.data.code === 200) {
          let data = res.data.data
          let _key = 1
          for (const item of data.list) {
            _key++
            item.key = _key
          }
          this.setState({
            recordTotal: data.total,
            recordData: data.list,
            recordLoading: false,
          })
        } else {
          this.setState({ recordLoading: false })
          message.error(res.data.message || '数据获取失败')
        }
      })
      .catch((err) => {
        this.setState({ recordLoading: false })
        message.error('数据获取失败')
      })
  }
  //获取 数据
  getExamData = () => {
    this.setState({ examLoading: true })
    let searchData = this.state.examSearchData
    let data = {}
    for (const key in searchData) {
      if (searchData[key] || searchData[key] === 0) {
        if (key === 'dept') {
          const orgType = confirmDeptByCode(
            searchData[key][searchData[key].length - 1]
          )
          if (orgType && orgType.type == 'cu') {
            data.cuNo = orgType.value
          } else if (orgType && orgType.type == 'bu') {
            data.buNo = orgType.value
          } else if (orgType && orgType.type == 'bd') {
            data.bdNo = orgType.value
          }
        } else {
          data[key] = searchData[key]
        }
      }
    }
    data.pageSize = this.state.examPageSize
    data.currentPage = this.state.examPage
    queryExamPage(data)
      .then((res) => {
        if (res.data.code === 200) {
          let data = res.data.data
          this.setState({
            examTotal: data.total,
            examData: data.list,
            examLoading: false,
          })
        } else {
          this.setState({ examLoading: false })
          message.error(res.data.message || '数据获取失败')
        }
      })
      .catch((err) => {
        this.setState({ examLoading: false })
        message.error('数据获取失败')
      })
  }
  //选择行
  recordSelectChange = (recordSelectedRowKeys, recordSelectedRows) => {
    this.setState({ recordSelectedRowKeys, recordSelectedRows })
  }
  examSelectChange = (examSelectedRowKeys, examSelectedRows) => {
    this.setState({ examSelectedRowKeys, examSelectedRows })
  }
  //修改页数changePage
  changeRecordPage = (page, pageSize) => {
    this.setState(
      {
        page,
        pageSize,
      },
      () => {
        this.getRecordData()
      }
    )
  }
  changeExamPage = (examPage, examPageSize) => {
    this.setState(
      {
        examPage,
        examPageSize,
      },
      () => {
        this.getExamData()
      }
    )
  }
  //搜索
  recordSearch = (data) => {
    let recordSearchData = {}
    if (data.time) {
      const startTime = data.time[0].format('YYYY-MM-DD')
      const endTime = this.addDate(data.time[1].format('YYYY-MM-DD'), 1)
      recordSearchData = { ...data, endTime, startTime }
    } else {
      recordSearchData = { ...data }
    }
    delete recordSearchData.time
    this.setState({ recordSearchData: recordSearchData, page: 1 }, () => {
      this.getRecordData()
    })
  }
  examSearch = (data) => {
    let examSearchData = {}
    if (data.time) {
      const startTime = data.time[0].format('YYYY-MM-DD')
      const endTime = data.time[1].format('YYYY-MM-DD')
      examSearchData = { ...data, endTime, startTime }
    } else {
      examSearchData = { ...data }
    }
    delete examSearchData.time
    this.setState({ examSearchData: examSearchData, examPage: 1 }, () => [
      this.getExamData(),
    ])
  }
  //设置按钮加载动画开关
  buttonLoading = (flag) => {
    this.setState({ confirmLoading: flag })
  }
  //隐藏模态框
  hiddenModal = () => {
    this.setState({
      recordModalVisible: false, //模态框
      examModalVisible: false,
      confirmLoading: false, //确认按钮异步等待
    })
  }
  //显示模态框
  showModal = (name) => {
    this.setState({
      recordModalVisible: name == 'record' ? true : false,
      examModalVisible: name == 'exam' ? true : false,
    })
  }
  //导出数据
  recordExport = () => {
    this.buttonLoading('true')
    let searchData = this.state.recordSearchData
    let data = {}
    for (const key in searchData) {
      if (searchData[key] || searchData[key] === 0) {
        if (key === 'dept') {
          const orgType = confirmDeptByCode(
            searchData[key][searchData[key].length - 1]
          )
          if (orgType && orgType.type == 'cu') {
            data.cuNo = orgType.value
          } else if (orgType && orgType.type == 'bu') {
            data.buNo = orgType.value
          } else if (orgType && orgType.type == 'bd') {
            data.bdNo = orgType.value
          }
        } else {
          data[key] = searchData[key]
        }
      }
    }
    asyncRecordExport(data)
      .then((res) => {
        if (res.data.code === 200) {
          message.success('导出任务已建立，请在导入导出详情页面查看导出进展。')
          this.hiddenModal()
          this.buttonLoading(false)
        } else {
          message.error(res.data.message || '导出任务建立失败')
          this.buttonLoading(false)
        }
      })
      .catch((err) => {
        message.error('导出任务建立失败')
        this.buttonLoading(false)
      })
  }
  examExport = () => {
    this.buttonLoading('true')
    let searchData = this.state.examSearchData
    let data = {}
    for (const key in searchData) {
      if (searchData[key] || searchData[key] === 0) {
        if (key === 'dept') {
          const orgType = confirmDeptByCode(
            searchData[key][searchData[key].length - 1]
          )
          if (orgType && orgType.type == 'cu') {
            data.cuNo = orgType.value
          } else if (orgType && orgType.type == 'bu') {
            data.buNo = orgType.value
          } else if (orgType && orgType.type == 'bd') {
            data.bdNo = orgType.value
          }
        } else {
          data[key] = searchData[key]
        }
      }
    }
    asyncExamExport(data)
      .then((res) => {
        if (res.data.code === 200) {
          message.success('导出任务已建立，请在导入导出详情页面查看导出进展。')
          this.hiddenModal()
          this.buttonLoading(false)
        } else {
          message.error(res.data.message || '导出任务建立失败')
          this.buttonLoading(false)
        }
      })
      .catch((err) => {
        message.error('导出任务建立失败')
        this.buttonLoading(false)
      })
  }

  tabChange = (key) => {
    this.setState(
      {
        activeKey: key,
        recordSearchData: [],
        examSearchData: [],
        recordSelectedRowKeys: [], //最新表格多选
        recordSelectedRows: [],
        examSelectedRowKeys: [], // 表格多选
        examSelectedRows: [],
        recordTotal: 0,
        pageSize: 10,
        page: 1,
        examTotal: 0,
        examPageSize: 10,
        examPage: 1,
      },
      () => {
        if (key == '2') this.getExamData()
        if (key == '1') this.getRecordData()
      }
    )
  }
  componentWillMount() {
    //获取表单数据
    this.getRecordData()
  }
  componentDidMount() {}
  //组件销毁时取消setState
  componentWillUnmount() {
    this.setState = (state, callback) => {
      return
    }
  }
  render() {
    //多选行配置
    const recordRowSelection = {
      recordSelectedRowKeys: this.state.recordSelectedRowKeys,
      onChange: this.recordSelectChange,
    }
    const examRowSelection = {
      recordSelectedRowKeys: this.state.examSelectedRowKeys,
      onChange: this.examSelectChange,
    }
    return (
      <div id="evaluate">
        <div className="myProjectsBody">
          <Tabs onChange={this.tabChange}>
            <Tabs.TabPane tab="可信档案报表" key="1">
              <div className="bigContent2">
                <AdvancedSearchForm
                  execSearch={this.recordSearch}
                  formData={this.state.recordSearchForm}
                />
              </div>
              <div className="segmentationDiv"></div>
              <div className="tabstyle">
                <div className="bigContent1">
                  <div className="operatingDiv">
                    <div style={{ textAlign: 'right' }}>
                      <HasPermi
                        bottonData={{
                          type: 'ghost',
                          interceptor: 'tmfs:reportForm:export',
                          clickFn: () => this.showModal('record'),
                          icon: <DownloadOutlined />,
                          text: '导出',
                        }}
                      />
                    </div>
                  </div>
                  <div className="tableDiff">
                    <Table
                      loading={this.state.recordLoading}
                      style={{ marginTop: 10 }}
                      scroll={{ x: '100' }}
                      columns={this.state.recordColumns}
                      dataSource={this.state.recordData}
                      pagination={{
                        total: this.state.recordTotal,
                        pageSize: this.state.pageSize,
                        current: this.state.page,
                        showSizeChanger: true,
                        onChange: this.changeRecordPage,
                        onShowSizeChange: this.changePageSize,
                        showTotal: (total) => '共 ' + total + ' 条',
                      }}
                      bordered
                    />
                  </div>
                </div>
              </div>
            </Tabs.TabPane>
            <Tabs.TabPane tab="考试成绩报表" key="2">
              <div className="bigContent2">
                <AdvancedSearchForm
                  execSearch={this.examSearch}
                  formData={this.state.examSearchForm}
                />
              </div>
              <div className="segmentationDiv"></div>
              <div className="tabstyle">
                <div className="bigContent1">
                  <div className="operatingDiv">
                    <div style={{ textAlign: 'right' }}>
                      <HasPermi
                        bottonData={{
                          type: 'ghost',
                          interceptor: 'tmfs:reportForm:export',
                          clickFn: () => this.showModal('exam'),
                          icon: <DownloadOutlined />,
                          text: '导出',
                        }}
                      />
                    </div>
                  </div>
                  <div className="tableDiff">
                    <Table
                      rowKey="id"
                      loading={this.state.examLoading}
                      scroll={{ x: '100' }}
                      style={{ marginTop: 10 }}
                      columns={this.state.examColumns}
                      dataSource={this.state.examData}
                      pagination={{
                        total: this.state.examTotal,
                        pageSize: this.state.examPageSize,
                        current: this.state.examPage,
                        showSizeChanger: true,
                        onChange: this.changeExamPage,
                        showTotal: (total) => '共 ' + total + ' 条',
                      }}
                      bordered
                    />
                  </div>
                </div>
              </div>
            </Tabs.TabPane>
          </Tabs>
        </div>

        {/* 导出 */}
        <NewModal
          modalOptions={{
            width: '400px',
            title: '导出可信档案数据',
            destroyOnClose: true,
            visible: this.state.recordModalVisible,
            onCancel: this.hiddenModal,
          }}
          buttonOptions={{
            position: 'center',
            btnList: [
              {
                key: 0,
                onClick: this.recordExport,
                text: '确认',
                type: 'primary',
                loading: this.state.confirmLoading,
              },
              {
                key: 1,
                onClick: this.hiddenModal,
                text: '取消',
              },
            ],
          }}
        >
          <div>确认导出全部可信档案数据？</div>
        </NewModal>
        <NewModal
          modalOptions={{
            width: '400px',
            title: '导出考试成绩数据',
            destroyOnClose: true,
            visible: this.state.examModalVisible,
            onCancel: this.hiddenModal,
          }}
          buttonOptions={{
            position: 'center',
            btnList: [
              {
                key: 0,
                onClick: this.examExport,
                text: '确认',
                type: 'primary',
                loading: this.state.confirmLoading,
              },
              {
                key: 1,
                onClick: this.hiddenModal,
                text: '取消',
              },
            ],
          }}
        >
          <div>确认导出全部考试成绩数据？</div>
        </NewModal>
      </div>
    )
  }
}
export default Index
